﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>切换图片的特殊效果</title>
    <script type="text/javascript" language="JavaScript">
        var imgUrl=new Array();
        var imgLink=new Array();
        var adNum=0;
        var jumpUrl="http://pic.music.tom.com/view/35611/tid-35611-pid-1.html";
        imgLink[1]="http://pic.music.tom.com/view/35611";
        imgLink[2]="http://pic.music.tom.com";
        imgUrl[1]="http://cimg.163.com/tech/2006/1/18/2006011810122068706.jpg";
        imgUrl[2]="http://cimg.163.com/tech/2006/1/17/200601171002503f251.jpg";
        var imgPre=new Array();
        var j=0;
        for (i=1;i<=imgUrl.length-1;i++)
        {
            if(imgLink[i]!="") {j++;}
            else {break;}
        }
        function playTran()
        {
            if (document.all)
                imgInit.filters.revealTrans.play();
        }
        var key=0;
        //循环显示图片
        function nextAd()
        {
            if(adNum<j)adNum++ ;
            else adNum=1;
            if( key==0 ){key=1;}
            else if (document.all){
                imgInit.filters.revealTrans.Transition=6;
                imgInit.filters.revealTrans.apply();
                playTran();
            }
            document.images.imgInit.src=imgUrl[adNum];
            jumpUrl=imgLink[adNum];
            theTimer=setTimeout("nextAd()", 7000);
        }
        //单击图片时实现导航
        function goUrl()
        {
            if (jumpUrl != ''){
                if (jumpTarget != '') window.open(jumpUrl,'_blank');
                else location.href=jumpUrl;
            }
        }
    </script>
</head>
<body>
<a href="javascript:goUrl()">
    <img src="javascript:nextAd()" width="300" border="0" name="imgInit" height="210"></a>
</body>
</html>